<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<script type="text/javascript"
	src="<c:url value="/js/jquery-easyui-1.5.5.6/jquery.min.js"/>"></script>
<script type="text/javascript"
	src="<c:url value="/js/jquery-easyui-1.5.5.6/jquery.easyui.min.js"/>"></script>
<script type="text/javascript"
	src="<c:url value="/js/jquery-easyui-1.5.5.6/locale/easyui-lang-zh_CN.js"/>"></script>
<link rel="stylesheet" type="text/css"
	href="<c:url value="/js/jquery-easyui-1.5.5.6/themes/default/easyui.css"/>" />
<link rel="stylesheet" type="text/css"
	href="<c:url value="/js/jquery-easyui-1.5.5.6/themes/icon.css"/>" />
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>请假确认新增</title>
</head>
<body>
	<script type="text/javascript">
		$(function() {
			/* 清单查找 */
			$('#deptid').textbox({
				icons : [ {
					iconCls : 'icon-add',
					handler : function(e) {
						$("#deptfindalls").dialog("open");
						//双击获取值
						$('#team_shet').datagrid({onDblClickRow:function(index,row){
								var paperinsertid=row.DEFIDE_ID;
								var paperinsertname=row.DEFIDE_NAME;
								$('#deptid').textbox("setValue",paperinsertid);
								$('#deptname').textbox("setValue",paperinsertname);
								//关闭窗口
								$('#deptfindalls').dialog('close');
							}
						});
					}
				}]
			});

			//返回
			$('.returnteam').linkbutton({
				onClick : function() {
					$("#teamshet").panel({
						href : "to_core_team"
					});
				}
			});
			//
			$(".submit_team_add").linkbutton({onClick:function(){
				if($("#deptid").textbox("getText")==""||$("#deptname").textbox("getValue")==""||
						$("#team_add").textbox("getValue")==""|| $("#statesone").datetimebox("getText")==""||
						$("#endtwe").datetimebox("getText")==""||$("#yythree").textbox("getText")==""){
					$.messager.alert('提示', '请填写全部内容');
				}else{
				$("<form method='post'>").appendTo(document.body).form({
					url: 'shq_team_adds',
					onSubmit: function(params){
						params["defideId"] = $("#deptid").textbox("getText");
						params["defideName"] = $("#deptname").textbox("getValue");
						params["teamName"] = $("#team_add").textbox("getValue");
						params["teamTakeeffect"] = $("#statesone").datetimebox("getText");
						params["teamLnvalid"] = $("#endtwe").datetimebox("getText");
						params["teamRemarks"] = $("#yythree").textbox("getText");
					},
					success:function(v){
						v = eval("(" + v + ")");
						if(v.success){
							$("#teamshet").panel({
								href : "to_core_team"
							});
						}else{
							$.messager.alert('错误', '对不起，操作失败，原因：' + v.message);
						}
					}
				}).submit();
				}
			}});
			
		});
	</script>

	<div id="teamshet" class="easyui-panel"
		data-options="fit:true,border:false">
		<div style="margin: 15px">
			<div id="insert_bt" class="insert_bt" style="margin: 10px">
				<a href="#" class="easyui-linkbutton returnteam" iconCls="icon-reload"
					plain="true" title="返回" data-options="text:'返回'"></a> <a
					class="easyui-linkbutton submit_team_add"
					data-options="text:'添加',iconCls:'icon-add',plain:true"></a> <span
					style="float: right; font-size: 12px; margin-top: 5px;margin-right: 10px;">新增：班组</span>
			</div>

			<div style="font-size: 14px;">概要</div>
			<div
				style="border-top: 2px solid #19aa8d; width: 400px; height: 180px; display: inline-block;">
				<table cellspacing="10">
					<tbody>
						<tr>
							<td><input class="easyui-textbox" editable="false"id="deptid"
								data-options="label:'*部门编号', width:300,labelWidth:130" /></td>
							
						</tr>
						<tr>
							<td><input class="easyui-textbox" editable="false"id="deptname"
								data-options="label:'*部门名称', width:300,labelWidth:130" /></td>
						</tr>
						<tr>
							<td><input class="easyui-textbox" id="team_add"
								data-options="label:'*班组名称', width:300,labelWidth:130" /></td>
						</tr>
					</tbody>
				</table>
			</div>
			<div
				style="border-top: 2px solid #19aa8d; height: 180px; width: 400px; display: inline-block; margin-left: 10px">
				<table cellspacing="10">
					<tbody>
						<tr>
							<td><input id="statesone" editable="false"class="easyui-datetimebox"
								data-options="label:'*生效时日', width:350,labelWidth:130" /></td>
						</tr>
						<tr>
							<td><input id="endtwe" editable="false"class="easyui-datetimebox"
								data-options="label:'*失效时日', width:350,labelWidth:130" /></td>
						</tr>
					</tbody>
				</table>
			</div>
			<div style="font-size: 14px;">备注</div>
			<div
				style="border-top: 2px solid #19aa8d; width: 800px; height: 130px; display: inline-block; margin-right: 15px; padding-top: 10px;">
				<input id="yythree" class="easyui-textbox"
					data-options="width:800,height:100,multiline:true" />
			</div>
			<!--dialog1-->
			<!--清单查找-->
			<div id="deptfindalls" class="easyui-dialog"
				data-options="
		width:450,
		title:'清单查找-部门',
		bodyCls:'awby',
		modal:true,
		closed:true,
		buttons:[{
				text:'添加',
				iconCls:'icon-ok',
				handler:function(){
					$('#teamadd_form').form({
							onSubmit:function(){
								var row=$('#team_shet').datagrid('getSelected');
								var paperinsertid=row.DEFIDE_ID;
								var paperinsertname=row.DEFIDE_NAME;
								$('#deptid').textbox('setValue',paperinsertid);
								$('#deptname').textbox('setValue',paperinsertname);
							},
							success:function(v){
								$('#deptfindalls').dialog('close');
							}
						}).submit();
				}
			},{
				text:'关闭',
				iconCls:'icon-cancel',
				handler:function(){
					$('#deptfindalls').dialog('close');
				}
			}]">
				<div>
					<form action="" id="teamadd_form">
						<table id="list_lookup">
						</table>
					</form>
				</div>
				<div id="xiaoid">
					<input class="easyui-searchbox" data-options="label:'搜索文本', width:200,labelWidth:60,       
							 searcher:function(value,name){
						      $('#one_shets').datagrid('load','shq_sheetyg_list_query?stainName='+value);      
					 }"/> 
				</div>
				<table class="easyui-datagrid" id="team_shet"
					data-options="   
				method:'post',
				pagination:true,     
				pageSize:5,   
				url:'findlaldept',  
				pageList: [5,10,15,20,25], 
				rownumbers:true,
				Striped:true, 
				singleSelect:true,
				striped:true
				">
					<thead>
						<tr>
							<th data-options="field:'DEFIDE_ID'">部门编号</th>
							<th data-options="field:'DEFIDE_NAME'">部门名称</th>
						</tr>
					</thead>
					<tbody>
					</tbody>
				</table>
			</div>
		</div>
	</div>
</body>
</html>